package com.cloud.salon.client.business.controller;

import com.cloud.salon.client.business.service.PaymentService;
import com.cloud.salon.common.base.response.Res;
import com.cloud.salon.common.base.entity.business.Payment;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Description 付款管理控制器
 * @Author wolf--LZH
 * @CreateDate 2019/4/10 0010 下午 1:30
 */
@RestController
@RequestMapping("payment")
@Api(tags = "支付信息相关接口")
public class PaymentController {

    private final String name = "支付信息";

    @Autowired
    private PaymentService service;

    @PostMapping("findById")
    @ApiOperation(value="通过id查找一个" + name)
    public Res<Payment> findById(@RequestBody Integer id) {
        return service.findById(id);
    }

    @PostMapping("findByRecord")
    @ApiOperation(value="通过记录获取对应的" + name)
    public Res<List<Payment>> findByRecord(@RequestBody Integer recordId) {
        return service.findByRecord(recordId);
    }

//    @PostMapping("findAll")
//    @ApiOperation(value="获取所有的" + name)
//    public Res<List<Payment>> findAll() {
//        return service.findAll();
//    }
}
